package interfaceGraphique;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JPanel;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.Dimension;
import java.lang.Short;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JButton;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;

import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;

public class GestionMatiereUE extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel NomMatiereLabel = null;
	private JTextField NomMatiereTextField = null;
	private JLabel CoefficientLabel = null;
	private JTextField NBEctsTextField = null;
	private JScrollPane DescriptionScrollPane = null;
	private JTextArea DescriptionTextArea = null;
	private JPanel ButtonsDescMatierePane = null;
	private JButton ValiderButton = null;
	private JButton AnnulerButton = null;
	private JPanel DescriptionPane = null;
	/**
	 * This method initializes 
	 * 
	 */
	public GestionMatiereUE() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 */
	private void initialize() {
        GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
        gridBagConstraints6.gridx = 0;
        gridBagConstraints6.gridwidth = 4;
        gridBagConstraints6.fill = GridBagConstraints.BOTH;
        gridBagConstraints6.gridheight = 1;
        gridBagConstraints6.weightx = 1.0;
        gridBagConstraints6.weighty = 1.0;
        gridBagConstraints6.gridy = 2;
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.insets = new Insets(0, 0, 0, 25);
        gridBagConstraints5.gridy = 6;
        gridBagConstraints5.gridwidth = 2;
        gridBagConstraints5.gridx = 0;
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.fill = GridBagConstraints.BOTH;
        gridBagConstraints4.gridy = 1;
        gridBagConstraints4.ipadx = 0;
        gridBagConstraints4.ipady = 0;
        gridBagConstraints4.weightx = 1.0;
        gridBagConstraints4.gridx = 1;
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.fill = GridBagConstraints.BOTH;
        gridBagConstraints3.gridy = 0;
        gridBagConstraints3.ipadx = 0;
        gridBagConstraints3.ipady = 0;
        gridBagConstraints3.weightx = 1.0;
        gridBagConstraints3.gridx = 1;
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints2.gridy = 0;
        gridBagConstraints2.anchor = GridBagConstraints.WEST;
        gridBagConstraints2.gridwidth = 0;
        gridBagConstraints2.gridheight = 1;
        gridBagConstraints2.gridx = 0;
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints1.gridy = 1;
        gridBagConstraints1.anchor = GridBagConstraints.WEST;
        gridBagConstraints1.gridx = 0;
        NomMatiereLabel = new JLabel();
		NomMatiereLabel.setText("Nom :");
		CoefficientLabel = new JLabel();
		CoefficientLabel.setText("Coefficient :");
        this.setLayout(new GridBagLayout());
        this.setSize(new Dimension(360, 190));
        this.setBorder(new EmptyBorder(10,10,10,10));
        this.add(CoefficientLabel, gridBagConstraints1);
        this.add(NomMatiereLabel, gridBagConstraints2);
        this.add(getNBEctsTextField(), gridBagConstraints3);
        this.add(getNomMatiereTextField(), gridBagConstraints4);
        this.add(getButtonsDescMatierePane(), gridBagConstraints5);
        this.add(getDescriptionPane(), gridBagConstraints6);
	}

	/**
	 * This method initializes NomMatiereTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getNomMatiereTextField() {
		if (NomMatiereTextField == null) {
			NomMatiereTextField = new JTextField();
			NomMatiereTextField.setMaximumSize(new Dimension(Short.MAX_VALUE, 30));
		}
		return NomMatiereTextField;
	}



	/**
	 * This method initializes NBEctsTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getNBEctsTextField() {
		if (NBEctsTextField == null) {
			NBEctsTextField = new JTextField();
			NBEctsTextField.setMaximumSize(new Dimension(Short.MAX_VALUE, 30));
		}
		return NBEctsTextField;
	}

	/**
	 * This method initializes DescriptionScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getDescriptionScrollPane() {
		if (DescriptionScrollPane == null) {
			DescriptionScrollPane = new JScrollPane();
			DescriptionScrollPane.setViewportView(getDescriptionTextArea());
		}
		return DescriptionScrollPane;
	}

	/**
	 * This method initializes DescriptionTextArea	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getDescriptionTextArea() {
		if (DescriptionTextArea == null) {
			DescriptionTextArea = new JTextArea();

		}
		return DescriptionTextArea;
	}

	/**
	 * This method initializes ButtonsDescMatierePane	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getButtonsDescMatierePane() {
		if (ButtonsDescMatierePane == null) {
			ButtonsDescMatierePane = new JPanel();
			ButtonsDescMatierePane.setLayout(new BoxLayout(getButtonsDescMatierePane(), BoxLayout.X_AXIS));
			ButtonsDescMatierePane.add(Box.createHorizontalGlue());
			ButtonsDescMatierePane.add(getValiderButton(), null);
			ButtonsDescMatierePane.add(Box.createRigidArea(new Dimension(10,0)));
			ButtonsDescMatierePane.add(getAnnulerButton(), null);
			ButtonsDescMatierePane.add(Box.createHorizontalGlue());
		}
		return ButtonsDescMatierePane;
	}

	/**
	 * This method initializes ValiderButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getValiderButton() {
		if (ValiderButton == null) {
			ValiderButton = new JButton();
			ValiderButton.setText("Valider");
		}
		return ValiderButton;
	}

	/**
	 * This method initializes AnnulerButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getAnnulerButton() {
		if (AnnulerButton == null) {
			AnnulerButton = new JButton();
			AnnulerButton.setText("Annuler");
		}
		return AnnulerButton;
	}

	/**
	 * This method initializes DescriptionPane	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getDescriptionPane() {
		if (DescriptionPane == null) {
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
			gridBagConstraints.fill = GridBagConstraints.BOTH;
			gridBagConstraints.gridy = 0;
			gridBagConstraints.weightx = 1.0;
			gridBagConstraints.weighty = 1.0;
			gridBagConstraints.gridx = 0;
			DescriptionPane = new JPanel();
			TitledBorder DPBorder;
			DPBorder = BorderFactory.createTitledBorder("Description matiere");
			DescriptionPane.setBorder(DPBorder);
			DescriptionPane.setLayout(new GridBagLayout());
			DescriptionPane.add(getDescriptionScrollPane(), gridBagConstraints);
		}
		return DescriptionPane;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
